/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: Job
 * Author:   zhouheng
 * Date:     2019/6/24 23:24
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.golden.domain;

import lombok.Data;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2019/6/24
 * @since 1.0.0
 */
@Data
@ToString
@Table(name = "t_job")
public class Job {

    /**
     * 任务调度参数key
     */
    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";

    public enum ScheduleStatus {
        /**
         * 正常
         */
        NORMAL("0"),
        /**
         * 暂停
         */
        PAUSE("1");

        private String value;

        private ScheduleStatus(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    private Integer id;

    private Long jobId;

    private String cronExpression;

    private String status;

    private Date createTime;

    @Column(name = "BEAN_NAME")
    private String beanName;

    @Column(name = "METHOD_NAME")
    private String methodName;

    @Column(name = "PARAMS")
    private String params;
}